/**业务code */
export const WorkCode = 12156

const getCode = (code: number) => +`${WorkCode}${code}`

/**
 * @description: 请求结果集
 */
export enum ResultEnum {
  SUCCESS = getCode(200),
  ERROR = getCode(400),
  /**当前用户没有登录或者登录已失效，请重新登录 */
  UNAUTHORIZED = getCode(401),
  ACCOUNTNOTEXIST = getCode(702),
  ACCOUNTDISABLED = getCode(703),
  WRONGPASSWORD = getCode(704)
}

export const accountErrorMap = [getCode(601), getCode(603)]

export const passwordErrorMap = [
  getCode(604),
  getCode(605),
  getCode(608),
  getCode(609)
]

/**
 * @description: 请求方式
 */
export enum RequestEnum {
  GET = 'GET',
  POST = 'POST',
  PUT = 'PUT',
  DELETE = 'DELETE'
}

/**
 * @description:  headers contentType
 */
export enum ContentTypeEnum {
  // json
  JSON = 'application/json;charset=UTF-8',
  // form-data qs
  FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8',
  // form-data  upload
  FORM_DATA = 'multipart/form-data;charset=UTF-8'
}
